package cn.lin.domain;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author cn.Lin
 * @create 2024-12-01-20:35
 */
@Getter
@Setter
@Document(indexName = "user")
@AllArgsConstructor
@NoArgsConstructor
public class User {

    @Id
    @Field(type = FieldType.Integer,store = true,index = false)
    private Integer id;

    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")  //@Field 每个文档的字段配置（类型、是否索引、是否存储、分词器 ）
    private String username;

    private String pwd;

    @Field(type=FieldType.Text,index = true,store = true,analyzer = "ik_max_word")
    private String tel;

    private String headPhoto ;

    //建立与机构的一对多关系(虽然是多对多，但是excel导入的时候是一对多关系)
    private Organization organization ;

}
